import 'package:flutter/material.dart';

class UiKeepAliveWrapper extends StatefulWidget {
  const UiKeepAliveWrapper({
    super.key,
    required this.child,
    this.wantKeepAlive = true,
  });
  final Widget child;
  final bool wantKeepAlive;
  @override
  State<UiKeepAliveWrapper> createState() => _UiKeepAliveWrapperState();
}

class _UiKeepAliveWrapperState extends State<UiKeepAliveWrapper>
    with AutomaticKeepAliveClientMixin {
  @override
  Widget build(BuildContext context) {
    super.build(context);
    return widget.child;
  }

  @override
  bool get wantKeepAlive => widget.wantKeepAlive;
}
